package com.yupi.lkzyoj.judge.strategy.impl;

import com.yupi.lkzyoj.judge.codeSandBox.ICodeSandBox;
import com.yupi.lkzyoj.judge.codeSandBox.model.ExecuteCodeRequest;
import com.yupi.lkzyoj.judge.codeSandBox.model.ExecuteCodeResponse;
import com.yupi.lkzyoj.judge.strategy.JudgeStrategy;
import com.yupi.lkzyoj.judge.strategy.StrategyContext;
import com.yupi.lkzyoj.model.dto.questionsubmit.JudgeInfo;
import com.yupi.lkzyoj.model.entity.Question;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


public class JavaJudgeStrategyImpl implements JudgeStrategy {


    @Override
    public ExecuteCodeResponse doStrategy(ExecuteCodeRequest executeCodeRequest, ICodeSandBox sandBox) {

        // 传入请求参数进行沙箱代码执行
        ExecuteCodeResponse response = sandBox.executeCode(executeCodeRequest);
        return response;
    }
}
